package behavioral_pattern.chain_of_responsibility_pattern;

/**
 * 董事长：具体处理者
 */
public class President extends Approver{
    protected President(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getAmount() <500000){
            System.out.println("董事长"+this.name+"审批采购单："+request.getNumber()+",金额"+request.getAmount()+"元。采购目的："+request.getPurpose()+",");
        }else {
            this.approver.processRequest(request);
        }

    }
}
